import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import pkg from './package.json';

export default [
    // 浏览器 umd 构建
    {
        input: 'src/main.js',
        output: {
            name: 'howLongUntilLunch',
            file: pkg.browser,
            format: 'umd'
        },
        plugins: [
            nodeResolve(),
            commonjs()
        ]
    },
    {
        input: 'src/main.js',
        // 指出哪些模块需要被视为外部引入
        external: ['ms'],
        output: [
            {file: pkg.main, format: 'cjs'},
            {file: pkg.module, format: 'es'}
        ]
    }
];
